/*
* SettingsSaver.c
*
* Created: 6/30/2012 5:34:33 PM
*  Author: we
*/

#include <inttypes.h>
#include <avr/io.h>
#include <avr/iom8.h>
#include <avr/eeprom.h>

uint8_t EEMEM eeprombyte = 0x10; //store initial byte to eeprom
uint16_t EEMEM eepromword = 0x5555; //store initial word to eeprom
uint8_t EEMEM eepromstring[5] = {"Test\0"}; //store string to eeprom
	
int test(void)
{
	uint8_t RAMbyte; //RAM byte variable
	uint16_t RAMword; //RAM word variable
	uint8_t RAMstring[5]; //RAM array of bytes

	RAMbyte = eeprom_read_byte(&eeprombyte); //read byte from EEPROm and store to RAM
	RAMword = eeprom_read_word(&eepromword); //read word from EEPROM and store to RAM
	eeprom_read_block((void *)&RAMstring, (const void *)&eepromstring, 5); //copy string from EEPROM to RAM
	
	return 0;
}
